package com.zyfdroid.ambernicstartmenu.ui;

import android.app.Activity;
import android.app.NotificationManager;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import com.zyfdroid.ambernicstartmenu.R;

import java.io.IOException;

public class MainActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setTitle("配置控制中心权限");
        setContentView(R.layout.activity_main);
    }

    public void jumpToAccessibilitySettings(View view) {
        Intent intent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
        startActivity(intent);
    }

    public void jumpToWriteSettings(View view) {
        Intent intent = new Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS);
        intent.setData(Uri.parse("package:" + getPackageName()));
        startActivity(intent);
    }

    public void jumpToDefaultAssistantSettings(View view) {
        Intent intent = new Intent(Settings.ACTION_VOICE_INPUT_SETTINGS);
        startActivity(intent);
    }
    public void requestNotificationPermission(View view) {
        // 适配Android 8.0及以上版本
        Intent intent = new Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS);
        intent.putExtra(Settings.EXTRA_APP_PACKAGE, getPackageName());
        startActivity(intent);
    }



}
